import axios from 'axios'

export default {
    /**
     * 获取列表数据
     * @param params
     * @returns {AxiosPromise<any>}
     */
    fetch (params) {
        return axios.get('an/service/network', {
            params: params
        });
    },
    /**
     * 根据id获取详情
     */
    fetchById(id){
        return axios.get(`an/service/network/${id}`,);
    },
    /**
     * 创建网点
     * @param params
     * @returns {AxiosPromise<any>}
     */
    create(params){
        return axios.post('an/service/network',params);
    },
    /**
     * 删除网点
     * @param id
     * @returns {AxiosPromise<any>}
     */
    destroy(id){
        return axios.delete(`an/service/network/${id}`);
    },
    /**
     * 修改网点
     * @param id
     * @param params
     * @returns {AxiosPromise<any>}
     */
    update(id,params){
        return axios.patch(`an/service/network/${id}`, params);
    },

    /**
     * 获取关联站点列表
     */
    fetchLinkStation(params){
        return axios.post('an/service/network/station',params)
    },

    /**
     *更新关联站点
     */
    updateLinkStation(params){
        return axios.post('an/service/network/edit',params);
    }
}
